import React, { Component } from 'react'
import '../asserts/css/common.css'
import { withRouter, NavLink } from 'react-router-dom'
import rules from '../router/rules'
import RouterView from '../router'
class Layout extends Component {
    render() {
        return (
            <div>
                <RouterView routes={rules}></RouterView>
                {
                    this.props.location.pathname !== "/goodsdetail" ? <ul className="tabbar">

                        <li className="icon icon-home">
                            <NavLink activeClassName="router-link-active.icon-home" to="/index">
                                商城
                            </NavLink>
                        </li>


                        <li className="icon icon-cate">
                            <NavLink to="/cate" activeClassName=".router-link-active.icon-cate">
                                分类
                            </NavLink>
                        </li>


                        <li className="icon icon-cart">
                            <NavLink to="/cart">
                                <span className="badge">5</span>
                                购物车
                            </NavLink>
                        </li>

                        <li className="icon icon-user">
                            <NavLink to="/uncenter">
                            我的
                            </NavLink>
                        </li>
                    </ul> : ""
                }

            </div>
        )
    }
}
export default withRouter(Layout)